import request from "@/utils/request";

//我的兴趣项
export interface hobbyItem{
    groupType:string
    id:string
    name:string
    isChecked?:boolean
}
//我的兴趣列表
export type TypeHobbyList = hobbyItem[]

//搜索结果单项
export interface TypeSearchConItem{
    groupType: string
    name: string
    description: string
    momentCount: number
    id: string
}
//搜索结果
export interface TypeSearchRes{
    content:TypeSearchConItem[]
}

//推荐列表资源
export const reqRecommend = (pageSize:number,pageNum:number)=>{
    return request.get<null,any>('/moment/moments/rec/default',{params:{
            pageSize,
            pageNum
        }})
}

//我的兴趣
export const reqMyHobby = (pageSize:number,pageNum:number)=>{
    return request.get<null,any>('/avocation/avocations/rec/user',{
        params:{
            pageSize,
            pageNum
        }
    })
}

//搜索
export const reqSearchByName = (name:string)=> {
    return request.get<null, TypeSearchRes>('/avocation/avocations/search/findByName', {
        params: {name}
    })
}

// 主题
export const reqSubject = (pageSize:number)=>{
    return request.get<null,any>('/moment/activityZones/collect/default',{params:{pageSize}})
}

//综合榜
export const reqTotalList = (pageSize:number,pageNum:number)=>{
    return request.get<null,any>('/moment/moments/collect/original/integrated',{
        params:{
            pageSize,
            pageNum
        }
    })
}
//热练榜
export const reqHotList = (pageSize:number,pageNum:number)=>{
    return request.get<null,any>('/moment/moments/collect/original/popTraining',{
        params:{
            pageSize,
            pageNum
        }
    })
}
//新锐榜
export const reqNewList = (pageSize:number,pageNum:number)=>{
    return request.get<null,any>('/moment/moments/collect/original/newcomer',{
        params:{
            pageSize,
            pageNum
        }
    })
}
